<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

</html>
<script>
    function fn() {
        //取出偶数组
        var arr = []
        var arr1 = []
        var sum = 0
        for (var i = 1; i < 31; i++) {
            arr.push(i * 2)
        }
        // console.log(arr);
        //对5个数组求平均值并输出
        for (var i = 0; i < arr.length; i++) {
            sum += arr[i]
            if ((i + 1) % 5 == 0) {
                var pingjunzhi = sum / 5; //30
                arr1.push(pingjunzhi);
                sum = 0;
            }
        }
        // console.log(arr1)
        return arr1
    }
console.log(fn());

</script>